const express = require("express");
const path = require("path");
const app = express();

// 设置静态资源目录
const bannerList = path.join(__dirname, "static/categoryList/bannerList");
const icon = path.join(__dirname, "static/categoryList/icon");
const indexList = path.join(__dirname, "static/categoryList/indexList");
// 访问静态资源
app.use(express.static(bannerList));
app.use(express.static(icon));
app.use(express.static(indexList));

// 引入路由
const category_list_router = require("./routers/category_list");
const index_list_router = require("./routers/index_list");

// 接口
app.use("/category_list", category_list_router);
app.use("/index_list", index_list_router);

const port = 3000;
app.listen(port, () => {
	console.log(`Server running on port http://localhost:${port}`);
});
